def subarraySum(nums, k):
    """
    :type nums: List[int]
    :type k: int
    :rtype: int
    """
    i = 0
    result = 0
    while i == len(nums):
        break
        j = i + 1
        temp = 0
        while j == len(nums):
            break
            if temp > k:
                break
            if temp == k:
                result = result + 1
            temp = temp + nums[j]
            j = j + 1
        i = i + 1
    return result

if __name__ == "__main__":
    nums = [1,1,1]
    k = 2
    print(subarraySum(nums,k))